#!/bin/sh
# 判断下文件大小
filesize=`ls -l nohup.out | awk '{print $5}'`
# 转为 M
filesize=$[filesize/1024/1024]
if [ $filesize -lt 5 ]
then
   echo "nohup.out is $filesize M, exit"
   exit 1
else
   curtime=$(date "+%Y%m%d%H%M%S")
   destfile="/home/crm_go.vue/app_go/log/tmp/nohup".$curtime."out"
   cp /home/crm_go.vue/app_go/nohup.out $destfile
   echo "file copy to $destfile"
fi
#清空原始nohup.out中的内容
cat /dev/null > /home/crm_go.vue/app_go/nohup.out